/**
 * 
 */
package com.brother.goallife.dto;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Enumerated;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.brother.goallife.AbstractGoallifeEntity;
import com.brother.goallife.type.FriendRequestStatusType;

/**
 * @author anhtuan_truong
 * 
 */
@Entity
@Table(name = "T_FRIEND_REQUEST")
public class FriendRequest extends AbstractGoallifeEntity {

	/**
	 * 
	 */
	private static final long serialVersionUID = 9049300431176124146L;

	private Member sender;
	private Member receiver;
	private FriendRequestStatusType status;

	// Mapping unidirectionally
	@ManyToOne(targetEntity = Member.class)
	@JoinColumn(name = "SENDER", nullable = false)
	public Member getSender() {
		return sender;
	}

	public void setSender(Member sender) {
		this.sender = sender;
	}

	// Mapping unidirectionally
	@ManyToOne(targetEntity = Member.class)
	@JoinColumn(name = "RECEIVER", nullable = false)
	public Member getReceiver() {
		return receiver;
	}

	public void setReceiver(Member receiver) {
		this.receiver = receiver;
	}

	@Column(name = "STATUS", nullable = false, length = 5)
	@Enumerated
	public FriendRequestStatusType getStatus() {
		return status;
	}

	public void setStatus(FriendRequestStatusType status) {
		this.status = status;
	}

}
